import request from '@/utils/request';
import { other } from './prefix';

const artGalleryManage = {
  // 查询展厅列表
  getArtGallery(params) {
    return request.get(other + '/ys_stadiums', { params });
  },
  // 创建展厅
  createArtGallery(params) {
    return request.post(other + '/ys_stadiums', params);
  },
  // 更新展厅信息
  updArtGallery(id, params) {
    return request.post(other + '/ys_stadiums/' + id, params);
  },
  // 上传展厅封面
  uploadArtImage(id, params) {
    return request.post(other + '/ys_stadiums/' + id + '?op=upload_file&name=title_page', params);
  },
  // 删除展厅
  delArtImage(id) {
    return request.delete(other + '/ys_stadiums/' + id);
  },

  // 创建作品
  createImages(params) {
    return request.post(other + '/ys_stadiums_image', params);
  },
  // 获取作品列表
  getImages(params) {
    return request.get(other + '/ys_stadiums_image', { params });
  },
  // 更新作品信息
  updImages(id, params) {
    return request.post(other + '/ys_stadiums_image/' + id, params);
  },
  // 上传作品封面
  uploadImagesBanner(id, params) {
    return request.post(other + '/ys_stadiums_image/' + id + '?op=upload_file&name=title_page', params)
  },
  // 上传作品视频
  uploadImagesVideo(id, params) {
    return request.post(other + '/ys_stadiums_image/' + id + '?op=upload_file&name=video_url', params);
  },
  // 删除作品
  delImages(params) {
    return request.delete(other + '/ys_stadiums_image/' + params.id);
  },

  // 创建开幕式
  createOpens(params) {
    return request.post(other + '/ys_stadiums_open', params);
  },
  // 获取开幕式列表
  getOpens(params) {
    return request.get(other + '/ys_stadiums_open', { params });
  },
  // 更新开幕式信息
  updOpens(id, params) {
    return request.post(other + '/ys_stadiums_open/' + id, params);
  },
  // 上传开幕式视频
  uploadOpensVideo(id, params, process) {
    return request.post(other + '/ys_stadiums_open/' + id + '?op=upload_file&name=video_url', params, {
      onUploadProgress: process
    });
  },
  // 删除开幕式
  delOpens(params) {
    return request.delete(other + '/ys_stadiums_open/' + params.id);
  },

  // 创建展览
  createPictures(params) {
    return request.post(other + '/ys_stadiums_pictures', params);
  },
  // 获取展览列表
  getPictures(params) {
    return request.get(other + '/ys_stadiums_pictures', { params });
  },
  // 更新展览信息
  updPictures(id, params) {
    return request.post(other + '/ys_stadiums_pictures/' + id, params);
  },
  // 上传展览视频
  uploadPicturesVideo(id, params) {
    return request.post(other + '/ys_stadiums_pictures/' + id + '?op=upload_file&name=video_url', params);
  },
  // 删除展览
  delPictures(params) {
    return request.delete(other + '/ys_stadiums_pictures/' + params.id);
  },


};

export default artGalleryManage;
